<ol class="breadcrumb">
    <li><a href="#">点单服务</a></li>
    <li><a href="/cafe/goods/list">商品管理</a></li>
    <li>编辑商品</li>
</ol>

<div class="panel panel-default">
    <div class="panel-heading">
        <span class="glyphicon glyphicon-pencil"></span>
        <span class="panel-title">请填写商品信息</span>
    </div>
    <div class="panel-body">
        <form action="/cafe/goods/edit/<%= data.goods._id %>" method="post" enctype="multipart/form-data"
              class="form-horizontal">
            <div class="form-group">
                <label class="control-label col-xs-2">商品类目</label>

                <div class="col-xs-9">
                    <select name="category" class="form-control">
                        <option value="">请选择商品类目</option>
                        <% data.categories.forEach(function(el, index, list){ %>
                        <option value="<%= el.value %>" <%= data.goods.category_id == el.value ? 'selected=selected' : '' %>><%= el.name %></option>
                        <% }); %>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2">商品名称</label>

                <div class="col-xs-9">
                    <input type="text" name="name" class="form-control" placeholder="请输入商品名称"
                           value="<%= data.goods.name %>">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2">商品价格</label>

                <div class="col-xs-9">
                    <div class="input-group">
                        <span class="input-group-addon">￥</span>
                        <input type="text" name="price" class="form-control" placeholder="请输入商品价格（单位：元）"
                               value="<%= data.goods.price_cn %>">
                        <span class="input-group-addon">.00</span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2">商品备注</label>

                <div class="col-xs-9">
                    <input type="text" name="note" class="form-control" placeholder="请输入商品备注"
                           value="<%= data.goods.note %>">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-2">商品图片</label>

                <div class="col-xs-9">
                    <input type="file" name="pic" class="form-control" placeholder="请输入商品图片">

                    <div class="thumbnail col-xs-2" style="margin-top: 5px;">
                        <img src="<%= data.goods.pic_url %>?imageView2/2/w/200/interlace/0/q/50"/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-2 col-xs-offset-2">
                    <input type="submit" class="form-control btn btn-success">
                </div>
            </div>
        </form>
    </div>
</div>